<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>SystemSharp: SystemSharp.Common.MathExt Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">SystemSharp
   &#160;<span id="projectnumber">0.3</span>
   </div>
   <div id="projectbrief">A system-level modeling framework for designing real-time embedded systems</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_system_sharp_1_1_common_1_1_math_ext.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Properties</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Events</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_system_sharp_1_1_common_1_1_math_ext-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">SystemSharp.Common.MathExt Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>This static class provides some specialized mathematical operations.  
 <a href="class_system_sharp_1_1_common_1_1_math_ext.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a4b2e7feb6ba6b178967eeab53c122705"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a4b2e7feb6ba6b178967eeab53c122705">CeilPow2</a> (int number)</td></tr>
<tr class="memdesc:a4b2e7feb6ba6b178967eeab53c122705"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the smallest number P, such that P &gt;= <em>number</em>  and P is a power of 2.  <a href="#a4b2e7feb6ba6b178967eeab53c122705">More...</a><br/></td></tr>
<tr class="separator:a4b2e7feb6ba6b178967eeab53c122705"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73755fbe16c6e7cabd6dafd6c8e1e811"><td class="memItemLeft" align="right" valign="top">static uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a73755fbe16c6e7cabd6dafd6c8e1e811">CeilPow2</a> (uint number)</td></tr>
<tr class="memdesc:a73755fbe16c6e7cabd6dafd6c8e1e811"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the smallest number P, such that P &gt;= <em>number</em>  and P is a power of 2.  <a href="#a73755fbe16c6e7cabd6dafd6c8e1e811">More...</a><br/></td></tr>
<tr class="separator:a73755fbe16c6e7cabd6dafd6c8e1e811"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac96413cf918bc42968342161d929eee0"><td class="memItemLeft" align="right" valign="top">static ulong&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#ac96413cf918bc42968342161d929eee0">CeilPow2</a> (ulong number)</td></tr>
<tr class="memdesc:ac96413cf918bc42968342161d929eee0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the smallest number P, such that P &gt;= <em>number</em>  and P is a power of 2.  <a href="#ac96413cf918bc42968342161d929eee0">More...</a><br/></td></tr>
<tr class="separator:ac96413cf918bc42968342161d929eee0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a547d7f40005cc7f6d3a818159f0a54ea"><td class="memItemLeft" align="right" valign="top">static ulong&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a547d7f40005cc7f6d3a818159f0a54ea">CeilPow2</a> (double number)</td></tr>
<tr class="memdesc:a547d7f40005cc7f6d3a818159f0a54ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the smallest number P, such that P &gt;= <em>number</em>  and P is a power of 2.  <a href="#a547d7f40005cc7f6d3a818159f0a54ea">More...</a><br/></td></tr>
<tr class="separator:a547d7f40005cc7f6d3a818159f0a54ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8da768c3424f3b6ce0785d240111f9a6"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a8da768c3424f3b6ce0785d240111f9a6">FloorPow2</a> (int number)</td></tr>
<tr class="memdesc:a8da768c3424f3b6ce0785d240111f9a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the largest number P, such that P &lt;= <em>number</em>  and P is a power of 2.  <a href="#a8da768c3424f3b6ce0785d240111f9a6">More...</a><br/></td></tr>
<tr class="separator:a8da768c3424f3b6ce0785d240111f9a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abc51db0046fee0a17e8f4491fc5a4164"><td class="memItemLeft" align="right" valign="top">static ulong&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#abc51db0046fee0a17e8f4491fc5a4164">FloorPow2</a> (ulong number)</td></tr>
<tr class="memdesc:abc51db0046fee0a17e8f4491fc5a4164"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the largest number P, such that P &lt;= <em>number</em>  and P is a power of 2.  <a href="#abc51db0046fee0a17e8f4491fc5a4164">More...</a><br/></td></tr>
<tr class="separator:abc51db0046fee0a17e8f4491fc5a4164"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c866c9fc9b5d922c923f2bcf919335e"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a9c866c9fc9b5d922c923f2bcf919335e">FloorLog2</a> (long number)</td></tr>
<tr class="memdesc:a9c866c9fc9b5d922c923f2bcf919335e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes floor(log2(<em>number</em> )) for positive numbers, returns -1 otherwise  <a href="#a9c866c9fc9b5d922c923f2bcf919335e">More...</a><br/></td></tr>
<tr class="separator:a9c866c9fc9b5d922c923f2bcf919335e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacee9ed80323eb255dd905d1ee16f8e9"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#aacee9ed80323eb255dd905d1ee16f8e9">FloorLog2</a> (ulong number)</td></tr>
<tr class="memdesc:aacee9ed80323eb255dd905d1ee16f8e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes floor(log2(<em>number</em> )) for positive numbers, returns -1 otherwise  <a href="#aacee9ed80323eb255dd905d1ee16f8e9">More...</a><br/></td></tr>
<tr class="separator:aacee9ed80323eb255dd905d1ee16f8e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae4b6cd0984bab7b3fee85f4e6d496b0"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#aae4b6cd0984bab7b3fee85f4e6d496b0">CeilLog2</a> (int number)</td></tr>
<tr class="memdesc:aae4b6cd0984bab7b3fee85f4e6d496b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes ceil(log2(<em>number</em> )) for positive numbers, returns -1 otherwise  <a href="#aae4b6cd0984bab7b3fee85f4e6d496b0">More...</a><br/></td></tr>
<tr class="separator:aae4b6cd0984bab7b3fee85f4e6d496b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d1e636f15f22e1bcd3fa1cbcf97c66a"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a8d1e636f15f22e1bcd3fa1cbcf97c66a">CeilLog2</a> (ulong number)</td></tr>
<tr class="memdesc:a8d1e636f15f22e1bcd3fa1cbcf97c66a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes ceil(log2(<em>number</em> )) for positive numbers, returns -1 otherwise  <a href="#a8d1e636f15f22e1bcd3fa1cbcf97c66a">More...</a><br/></td></tr>
<tr class="separator:a8d1e636f15f22e1bcd3fa1cbcf97c66a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf898566e8553245eee003b39b7b3ddc"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#abf898566e8553245eee003b39b7b3ddc">CeilLog2</a> (double number)</td></tr>
<tr class="memdesc:abf898566e8553245eee003b39b7b3ddc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes ceil(log2(<em>number</em> )) for positive numbers  <a href="#abf898566e8553245eee003b39b7b3ddc">More...</a><br/></td></tr>
<tr class="separator:abf898566e8553245eee003b39b7b3ddc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bb12a753e6a855ad70ac552c29f82d2"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a5bb12a753e6a855ad70ac552c29f82d2">FloorLog2</a> (double number)</td></tr>
<tr class="memdesc:a5bb12a753e6a855ad70ac552c29f82d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes floor(log2(<em>number</em> )) for positive numbers  <a href="#a5bb12a753e6a855ad70ac552c29f82d2">More...</a><br/></td></tr>
<tr class="separator:a5bb12a753e6a855ad70ac552c29f82d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a211fd6cfa3f0906c3606837fd28db1ad"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a211fd6cfa3f0906c3606837fd28db1ad">IsPow2</a> (long number)</td></tr>
<tr class="memdesc:a211fd6cfa3f0906c3606837fd28db1ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines whether <em>number</em>  is a power of 2  <a href="#a211fd6cfa3f0906c3606837fd28db1ad">More...</a><br/></td></tr>
<tr class="separator:a211fd6cfa3f0906c3606837fd28db1ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adcf787281c09912b28d5d501a93287ef"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#adcf787281c09912b28d5d501a93287ef">IsPow2</a> (ulong number)</td></tr>
<tr class="memdesc:adcf787281c09912b28d5d501a93287ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines whether <em>number</em>  is a power of 2  <a href="#adcf787281c09912b28d5d501a93287ef">More...</a><br/></td></tr>
<tr class="separator:adcf787281c09912b28d5d501a93287ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d698326cece717fea170af80f3fcdd4"><td class="memItemLeft" align="right" valign="top">static ulong&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a5d698326cece717fea170af80f3fcdd4">Align</a> (ulong number, ulong alignment)</td></tr>
<tr class="memdesc:a5d698326cece717fea170af80f3fcdd4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the largest integer N, such that N &lt;= <em>number</em>  and N is divisble by <em>alignment</em> .  <a href="#a5d698326cece717fea170af80f3fcdd4">More...</a><br/></td></tr>
<tr class="separator:a5d698326cece717fea170af80f3fcdd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9efd72ddd9b28190ca805d9f968f99d0"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a9efd72ddd9b28190ca805d9f968f99d0">SignedSign</a> (float number)</td></tr>
<tr class="memdesc:a9efd72ddd9b28190ca805d9f968f99d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the sign of <em>number</em>  as Signed: Signed.FromInt(-1, 2) if <em>number</em>  &lt; 0, Signed.FromInt(1, 2) if <em>number</em>  &gt; 0, Signed.FromInt(0, 2) if <em>number</em>  == 0.  <a href="#a9efd72ddd9b28190ca805d9f968f99d0">More...</a><br/></td></tr>
<tr class="separator:a9efd72ddd9b28190ca805d9f968f99d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51f762e06bf88447a00484211803c78a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a51f762e06bf88447a00484211803c78a">SignedSign</a> (double number)</td></tr>
<tr class="memdesc:a51f762e06bf88447a00484211803c78a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the sign of <em>number</em>  as Signed: Signed.FromInt(-1, 2) if <em>number</em>  &lt; 0, Signed.FromInt(1, 2) if <em>number</em>  &gt; 0, Signed.FromInt(0, 2) if <em>number</em>  == 0.  <a href="#a51f762e06bf88447a00484211803c78a">More...</a><br/></td></tr>
<tr class="separator:a51f762e06bf88447a00484211803c78a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00b70af48cce2c91a027da714b806aee"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a00b70af48cce2c91a027da714b806aee">SignedSign</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a> number)</td></tr>
<tr class="memdesc:a00b70af48cce2c91a027da714b806aee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the sign of <em>number</em>  as Signed: Signed.FromInt(-1, 2) if <em>number</em>  &lt; 0, Signed.FromInt(1, 2) if <em>number</em>  &gt; 0, Signed.FromInt(0, 2) if <em>number</em>  == 0.  <a href="#a00b70af48cce2c91a027da714b806aee">More...</a><br/></td></tr>
<tr class="separator:a00b70af48cce2c91a027da714b806aee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee95bb9e5bfb447f048de0e1f774dbb1"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#aee95bb9e5bfb447f048de0e1f774dbb1">SignedSign</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> number)</td></tr>
<tr class="memdesc:aee95bb9e5bfb447f048de0e1f774dbb1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the sign of <em>number</em>  as Signed: Signed.FromInt(-1, 2) if <em>number</em>  &lt; 0, Signed.FromInt(1, 2) if <em>number</em>  &gt; 0, Signed.FromInt(0, 2) if <em>number</em>  == 0.  <a href="#aee95bb9e5bfb447f048de0e1f774dbb1">More...</a><br/></td></tr>
<tr class="separator:aee95bb9e5bfb447f048de0e1f774dbb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ec6a82dad694ed5b14ae4b8fa4ff6bd"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_unsigned.html">Unsigned</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a6ec6a82dad694ed5b14ae4b8fa4ff6bd">Abs</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a> value)</td></tr>
<tr class="memdesc:a6ec6a82dad694ed5b14ae4b8fa4ff6bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the absolute value of <em>value</em> . The result will have exactly the same bitwidth as the operand.  <a href="#a6ec6a82dad694ed5b14ae4b8fa4ff6bd">More...</a><br/></td></tr>
<tr class="separator:a6ec6a82dad694ed5b14ae4b8fa4ff6bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae470d37142b941ca626a83270d92465"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#aae470d37142b941ca626a83270d92465">SignedAbs</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a> value)</td></tr>
<tr class="memdesc:aae470d37142b941ca626a83270d92465"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the absolute value of <em>value</em>  as Signed datatype. Consequently, the most significant bit of the returned result is always 0. The result bitwidth will be 1 bit more than the operand bitwidth.  <a href="#aae470d37142b941ca626a83270d92465">More...</a><br/></td></tr>
<tr class="separator:aae470d37142b941ca626a83270d92465"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7c7ea083a62b2172f567bb7650e029d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_u_fix.html">UFix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#ab7c7ea083a62b2172f567bb7650e029d">Abs</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> value)</td></tr>
<tr class="memdesc:ab7c7ea083a62b2172f567bb7650e029d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the absolute value of <em>value</em> . The result will have exactly the same integer and fractional bitwidth as the operand.  <a href="#ab7c7ea083a62b2172f567bb7650e029d">More...</a><br/></td></tr>
<tr class="separator:ab7c7ea083a62b2172f567bb7650e029d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa512a47e4b1bb04f40481f96d32556d8"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#aa512a47e4b1bb04f40481f96d32556d8">SignedAbs</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> value)</td></tr>
<tr class="memdesc:aa512a47e4b1bb04f40481f96d32556d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the absolute value of <em>value</em>  as SFix datatype. Consequently, the most significant bit of the returned result is always 0. The result integer width is 1 bit more than the operand integer width. Fractional width stays the same.  <a href="#aa512a47e4b1bb04f40481f96d32556d8">More...</a><br/></td></tr>
<tr class="separator:aa512a47e4b1bb04f40481f96d32556d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe4823086728c9c77588c628a962a245"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_u_fix.html">UFix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#abe4823086728c9c77588c628a962a245">Sqrt</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_u_fix.html">UFix</a> value)</td></tr>
<tr class="memdesc:abe4823086728c9c77588c628a962a245"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the square root of <em>value</em> . The result format is as follows: Result integer width is ceil(<em>value.Format.IntWidth</em>  / 2). Result fractional width is <em>value.Format.TotalWidth</em>  - ceil(<em>value.Format.IntWidth</em> ).  <a href="#abe4823086728c9c77588c628a962a245">More...</a><br/></td></tr>
<tr class="separator:abe4823086728c9c77588c628a962a245"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40e016db708bbfb1ef078c9c4dd01784"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a40e016db708bbfb1ef078c9c4dd01784">Sin</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> value, int fracWidth)</td></tr>
<tr class="memdesc:a40e016db708bbfb1ef078c9c4dd01784"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the sine of <em>value</em> . The result integer width is always 2 bits, result fractional width is specified by <em>fracWidth</em> .  <a href="#a40e016db708bbfb1ef078c9c4dd01784">More...</a><br/></td></tr>
<tr class="separator:a40e016db708bbfb1ef078c9c4dd01784"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93c7e0bf7771b341d91da12e5384d460"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a93c7e0bf7771b341d91da12e5384d460">Cos</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> value, int fracWidth)</td></tr>
<tr class="memdesc:a93c7e0bf7771b341d91da12e5384d460"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the cosine of <em>value</em> . The result integer width is always 2 bits, result fractional width is specified by <em>fracWidth</em> .  <a href="#a93c7e0bf7771b341d91da12e5384d460">More...</a><br/></td></tr>
<tr class="separator:a93c7e0bf7771b341d91da12e5384d460"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95675c267e93fa55c09807b7f15075f2"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a95675c267e93fa55c09807b7f15075f2">Sin</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> value)</td></tr>
<tr class="memdesc:a95675c267e93fa55c09807b7f15075f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the sine of <em>value</em> . The result integer width is always 2 bits, result fractional width is that of <em>value</em> .  <a href="#a95675c267e93fa55c09807b7f15075f2">More...</a><br/></td></tr>
<tr class="separator:a95675c267e93fa55c09807b7f15075f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6c5fc632a44437ce5aca257caf43fed"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#ab6c5fc632a44437ce5aca257caf43fed">Cos</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> value)</td></tr>
<tr class="memdesc:ab6c5fc632a44437ce5aca257caf43fed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the cosine of <em>value</em> . The result integer width is always 2 bits, result fractional width is that of <em>value</em> .  <a href="#ab6c5fc632a44437ce5aca257caf43fed">More...</a><br/></td></tr>
<tr class="separator:ab6c5fc632a44437ce5aca257caf43fed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2f9d9f9d333ee51c849b1e21d1df1e7"><td class="memItemLeft" align="right" valign="top">static Tuple&lt; <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>, <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#aa2f9d9f9d333ee51c849b1e21d1df1e7">ScSinCos</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> value, int resultFracBits)</td></tr>
<tr class="memdesc:aa2f9d9f9d333ee51c849b1e21d1df1e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes both sine and cosine of <em>value</em> , specified in scaled radians. The conversion to radians is done by multiplying <em>value</em>  by PI. <em>value</em>  must be in the range from -1 to 1. The first element of the returned tuple is cosine, the second is sine. Integer width of sine/cosine result is 2, fractional width is specified by <em>resultFracBits</em> .  <a href="#aa2f9d9f9d333ee51c849b1e21d1df1e7">More...</a><br/></td></tr>
<tr class="separator:aa2f9d9f9d333ee51c849b1e21d1df1e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22654cef75fd7702442e371f00e2aa96"><td class="memItemLeft" align="right" valign="top">static Tuple&lt; double, double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a22654cef75fd7702442e371f00e2aa96">ScSinCos</a> (double value)</td></tr>
<tr class="memdesc:a22654cef75fd7702442e371f00e2aa96"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes both sine and cosine of <em>value</em> , specified in scaled radians. The conversion to radians is done by multiplying <em>value</em>  by PI. The first element of the returned tuple is cosine, the second is sine.  <a href="#a22654cef75fd7702442e371f00e2aa96">More...</a><br/></td></tr>
<tr class="separator:a22654cef75fd7702442e371f00e2aa96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a30f0525b01304f2276fde4c6f02f5778"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a30f0525b01304f2276fde4c6f02f5778">Rempow2</a> (<a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> value, int n)</td></tr>
<tr class="memdesc:a30f0525b01304f2276fde4c6f02f5778"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the remainder <em>value</em>  mod 2^n. Result integer width is 2 + <em>n</em> . Result fractional width is max(<em>value.Format.FracWidth</em> , -n).  <a href="#a30f0525b01304f2276fde4c6f02f5778">More...</a><br/></td></tr>
<tr class="separator:a30f0525b01304f2276fde4c6f02f5778"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a62aaaf71102eea889e0831dd9d29e1cd"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a62aaaf71102eea889e0831dd9d29e1cd">Rempow2</a> (double value, int n)</td></tr>
<tr class="memdesc:a62aaaf71102eea889e0831dd9d29e1cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the remainder <em>value</em>  mod 2^n.  <a href="#a62aaaf71102eea889e0831dd9d29e1cd">More...</a><br/></td></tr>
<tr class="separator:a62aaaf71102eea889e0831dd9d29e1cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b321a2b8567ad20e81bffd94dc9b2b6"><td class="memItemLeft" align="right" valign="top">static T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html#a0b321a2b8567ad20e81bffd94dc9b2b6">Select&lt; T &gt;</a> (bool cond, T trueVal, T falseVal)</td></tr>
<tr class="memdesc:a0b321a2b8567ad20e81bffd94dc9b2b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <em>trueVal</em>  if <em>cond</em>  is true, otherwise <em>falseVal</em> .  <a href="#a0b321a2b8567ad20e81bffd94dc9b2b6">More...</a><br/></td></tr>
<tr class="separator:a0b321a2b8567ad20e81bffd94dc9b2b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This static class provides some specialized mathematical operations. </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00037">37</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a6ec6a82dad694ed5b14ae4b8fa4ff6bd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_unsigned.html">Unsigned</a> SystemSharp.Common.MathExt.Abs </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the absolute value of <em>value</em> . The result will have exactly the same bitwidth as the operand. </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00342">342</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="ab7c7ea083a62b2172f567bb7650e029d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_u_fix.html">UFix</a> SystemSharp.Common.MathExt.Abs </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the absolute value of <em>value</em> . The result will have exactly the same integer and fractional bitwidth as the operand. </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00367">367</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a5d698326cece717fea170af80f3fcdd4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ulong SystemSharp.Common.MathExt.Align </td>
          <td>(</td>
          <td class="paramtype">ulong&#160;</td>
          <td class="paramname"><em>number</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ulong&#160;</td>
          <td class="paramname"><em>alignment</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Finds the largest integer N, such that N &lt;= <em>number</em>  and N is divisble by <em>alignment</em> . </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">DivideByZeroException</td><td>if <em>alignment</em>  == 0</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00246">246</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="aae4b6cd0984bab7b3fee85f4e6d496b0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int SystemSharp.Common.MathExt.CeilLog2 </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes ceil(log2(<em>number</em> )) for positive numbers, returns -1 otherwise </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00176">176</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a8d1e636f15f22e1bcd3fa1cbcf97c66a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int SystemSharp.Common.MathExt.CeilLog2 </td>
          <td>(</td>
          <td class="paramtype">ulong&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes ceil(log2(<em>number</em> )) for positive numbers, returns -1 otherwise </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00190">190</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="abf898566e8553245eee003b39b7b3ddc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int SystemSharp.Common.MathExt.CeilLog2 </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes ceil(log2(<em>number</em> )) for positive numbers </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if <em>number</em>  &lt;= 0</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00205">205</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a4b2e7feb6ba6b178967eeab53c122705"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int SystemSharp.Common.MathExt.CeilPow2 </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the smallest number P, such that P &gt;= <em>number</em>  and P is a power of 2. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if <em>number</em>  &lt; 0 or result would overflow</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>a non-negative number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00044">44</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a73755fbe16c6e7cabd6dafd6c8e1e811"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint SystemSharp.Common.MathExt.CeilPow2 </td>
          <td>(</td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the smallest number P, such that P &gt;= <em>number</em>  and P is a power of 2. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if result would overflow</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00060">60</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="ac96413cf918bc42968342161d929eee0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ulong SystemSharp.Common.MathExt.CeilPow2 </td>
          <td>(</td>
          <td class="paramtype">ulong&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the smallest number P, such that P &gt;= <em>number</em>  and P is a power of 2. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if result would overflow</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00076">76</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a547d7f40005cc7f6d3a818159f0a54ea"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ulong SystemSharp.Common.MathExt.CeilPow2 </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the smallest number P, such that P &gt;= <em>number</em>  and P is a power of 2. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if <em>number</em>  &lt; 0 or result would overflow</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00092">92</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a93c7e0bf7771b341d91da12e5384d460"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> SystemSharp.Common.MathExt.Cos </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fracWidth</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes the cosine of <em>value</em> . The result integer width is always 2 bits, result fractional width is specified by <em>fracWidth</em> . </p>
<p>This routine internally uses IEEE 754 double precision floating-point arithmetic. Therefore, it is not guaranteed that the result is precise, especially for high fractional widths (&gt; 52). </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if <em>fracWidth</em>  &lt; 0</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00436">436</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="ab6c5fc632a44437ce5aca257caf43fed"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> SystemSharp.Common.MathExt.Cos </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes the cosine of <em>value</em> . The result integer width is always 2 bits, result fractional width is that of <em>value</em> . </p>
<p>This routine internally uses IEEE 754 double precision floating-point arithmetic. Therefore, it is not guaranteed that the result is precise, especially for high fractional widths (&gt; 52). </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if <em>value.Format.FracWidth</em>  &lt; 0</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00476">476</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a9c866c9fc9b5d922c923f2bcf919335e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int SystemSharp.Common.MathExt.FloorLog2 </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes floor(log2(<em>number</em> )) for positive numbers, returns -1 otherwise </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00146">146</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="aacee9ed80323eb255dd905d1ee16f8e9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int SystemSharp.Common.MathExt.FloorLog2 </td>
          <td>(</td>
          <td class="paramtype">ulong&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes floor(log2(<em>number</em> )) for positive numbers, returns -1 otherwise </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00161">161</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a5bb12a753e6a855ad70ac552c29f82d2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int SystemSharp.Common.MathExt.FloorLog2 </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes floor(log2(<em>number</em> )) for positive numbers </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if <em>number</em>  &lt;= 0</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00217">217</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a8da768c3424f3b6ce0785d240111f9a6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int SystemSharp.Common.MathExt.FloorPow2 </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the largest number P, such that P &lt;= <em>number</em>  and P is a power of 2. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if <em>number</em>  &lt; 0 or result would overflow</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>a non-negative number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00108">108</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="abc51db0046fee0a17e8f4491fc5a4164"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ulong SystemSharp.Common.MathExt.FloorPow2 </td>
          <td>(</td>
          <td class="paramtype">ulong&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the largest number P, such that P &lt;= <em>number</em>  and P is a power of 2. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00128">128</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a211fd6cfa3f0906c3606837fd28db1ad"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool SystemSharp.Common.MathExt.IsPow2 </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determines whether <em>number</em>  is a power of 2 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00228">228</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="adcf787281c09912b28d5d501a93287ef"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool SystemSharp.Common.MathExt.IsPow2 </td>
          <td>(</td>
          <td class="paramtype">ulong&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determines whether <em>number</em>  is a power of 2 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>some number</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00237">237</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a30f0525b01304f2276fde4c6f02f5778"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> SystemSharp.Common.MathExt.Rempow2 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes the remainder <em>value</em>  mod 2^n. Result integer width is 2 + <em>n</em> . Result fractional width is max(<em>value.Format.FracWidth</em> , -n). </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00579">579</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a62aaaf71102eea889e0831dd9d29e1cd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static double SystemSharp.Common.MathExt.Rempow2 </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes the remainder <em>value</em>  mod 2^n. </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00589">589</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="aa2f9d9f9d333ee51c849b1e21d1df1e7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Tuple&lt;<a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>, <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&gt; SystemSharp.Common.MathExt.ScSinCos </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>resultFracBits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes both sine and cosine of <em>value</em> , specified in scaled radians. The conversion to radians is done by multiplying <em>value</em>  by PI. <em>value</em>  must be in the range from -1 to 1. The first element of the returned tuple is cosine, the second is sine. Integer width of sine/cosine result is 2, fractional width is specified by <em>resultFracBits</em> . </p>
<p>This routine internally uses IEEE 754 double precision floating-point arithmetic. Therefore, it is not guaranteed that the result is precise, especially for high fractional widths (&gt; 52). </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if <em>value</em>  not between -1 and 1, or if <em>resultFracBits</em>  &lt; 0</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00518">518</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a22654cef75fd7702442e371f00e2aa96"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Tuple&lt;double, double&gt; SystemSharp.Common.MathExt.ScSinCos </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes both sine and cosine of <em>value</em> , specified in scaled radians. The conversion to radians is done by multiplying <em>value</em>  by PI. The first element of the returned tuple is cosine, the second is sine. </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00543">543</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a0b321a2b8567ad20e81bffd94dc9b2b6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static T SystemSharp.Common.MathExt.Select&lt; T &gt; </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>cond</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>trueVal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>falseVal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns <em>trueVal</em>  if <em>cond</em>  is true, otherwise <em>falseVal</em> . </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00610">610</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="aae470d37142b941ca626a83270d92465"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a> SystemSharp.Common.MathExt.SignedAbs </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the absolute value of <em>value</em>  as Signed datatype. Consequently, the most significant bit of the returned result is always 0. The result bitwidth will be 1 bit more than the operand bitwidth. </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00354">354</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="aa512a47e4b1bb04f40481f96d32556d8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> SystemSharp.Common.MathExt.SignedAbs </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the absolute value of <em>value</em>  as SFix datatype. Consequently, the most significant bit of the returned result is always 0. The result integer width is 1 bit more than the operand integer width. Fractional width stays the same. </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00380">380</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a9efd72ddd9b28190ca805d9f968f99d0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a> SystemSharp.Common.MathExt.SignedSign </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the sign of <em>number</em>  as Signed: Signed.FromInt(-1, 2) if <em>number</em>  &lt; 0, Signed.FromInt(1, 2) if <em>number</em>  &gt; 0, Signed.FromInt(0, 2) if <em>number</em>  == 0. </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00260">260</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a51f762e06bf88447a00484211803c78a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a> SystemSharp.Common.MathExt.SignedSign </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the sign of <em>number</em>  as Signed: Signed.FromInt(-1, 2) if <em>number</em>  &lt; 0, Signed.FromInt(1, 2) if <em>number</em>  &gt; 0, Signed.FromInt(0, 2) if <em>number</em>  == 0. </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00277">277</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a00b70af48cce2c91a027da714b806aee"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a> SystemSharp.Common.MathExt.SignedSign </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a>&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the sign of <em>number</em>  as Signed: Signed.FromInt(-1, 2) if <em>number</em>  &lt; 0, Signed.FromInt(1, 2) if <em>number</em>  &gt; 0, Signed.FromInt(0, 2) if <em>number</em>  == 0. </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00294">294</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="aee95bb9e5bfb447f048de0e1f774dbb1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_signed.html">Signed</a> SystemSharp.Common.MathExt.SignedSign </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the sign of <em>number</em>  as Signed: Signed.FromInt(-1, 2) if <em>number</em>  &lt; 0, Signed.FromInt(1, 2) if <em>number</em>  &gt; 0, Signed.FromInt(0, 2) if <em>number</em>  == 0. </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00311">311</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a40e016db708bbfb1ef078c9c4dd01784"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> SystemSharp.Common.MathExt.Sin </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fracWidth</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes the sine of <em>value</em> . The result integer width is always 2 bits, result fractional width is specified by <em>fracWidth</em> . </p>
<p>This routine internally uses IEEE 754 double precision floating-point arithmetic. Therefore, it is not guaranteed that the result is precise, especially for high fractional widths (&gt; 52). </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if <em>fracWidth</em>  &lt; 0</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00416">416</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a95675c267e93fa55c09807b7f15075f2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a> SystemSharp.Common.MathExt.Sin </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_s_fix.html">SFix</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes the sine of <em>value</em> . The result integer width is always 2 bits, result fractional width is that of <em>value</em> . </p>
<p>This routine internally uses IEEE 754 double precision floating-point arithmetic. Therefore, it is not guaranteed that the result is precise, especially for high fractional widths (&gt; 52). </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ArgumentOutOfRangeException</td><td>if <em>value.Format.FracWidth</em>  &lt; 0</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00456">456</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<a class="anchor" id="abe4823086728c9c77588c628a962a245"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_system_sharp_1_1_data_types_1_1_u_fix.html">UFix</a> SystemSharp.Common.MathExt.Sqrt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_system_sharp_1_1_data_types_1_1_u_fix.html">UFix</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes the square root of <em>value</em> . The result format is as follows: Result integer width is ceil(<em>value.Format.IntWidth</em>  / 2). Result fractional width is <em>value.Format.TotalWidth</em>  - ceil(<em>value.Format.IntWidth</em> ). </p>
<p>This routine internally uses IEEE 754 double precision floating-point arithmetic. Therefore, it is not guaranteed that the result is precise, especially for high fractional widths (&gt; 52). </p>

<p>Definition at line <a class="el" href="_math_ext_8cs_source.html#l00397">397</a> of file <a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_math_ext_8cs_source.html">MathExt.cs</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_system_sharp.html">SystemSharp</a></li><li class="navelem"><a class="el" href="namespace_system_sharp_1_1_common.html">Common</a></li><li class="navelem"><a class="el" href="class_system_sharp_1_1_common_1_1_math_ext.html">MathExt</a></li>
    <li class="footer">Generated on Thu Dec 26 2013 14:21:58 for SystemSharp by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
